package cn.edu.scau.cmi.duke.composite.safe;

import java.util.ArrayList;

public class Team implements Organization {
	private String name=null;
	  public void setName(String name) {
		this. name=name;
	  }
	private ArrayList<Organization> parts= new ArrayList<>();
	
       public String getName(){
		 return name;
	 }
     void addOrg(Organization org){
	    if(org!=null) {
	    	 parts.add(org);
	    }
   }
     void removeOrg(Organization org) {
    	 if(parts.contains(org)) {
    			parts.remove(org);
    	 }
     }
     Organization getOrg(int index) {
    	 if(index<parts.size()) {
    		 return parts.get(index);
    	 }else {
    		 return null;
    	 }
     }
 
}
